var core = require('core');
var db = core.db;
var send = core.send;

var find = function(req, res, next) {
    var body = req.body;
    db.schema.Merchant.findOne(body, function(err, merchant){
        var SEND;
        if(err)
            SEND = new send(100000);
        else if(!merchant)
            SEND = new send(100300);
        else{
            SEND = new send(0);
            SEND.docs = merchant;
        };
        res.send(SEND);
    });
};

module.exports = find;
